
/**
 * 部门选择器弹窗
 */
var opendeptselectWindow =function(json,name,valuefield,projectName){
	mini.open({
        url: projectName+"/OrgAdmin/orgselect",
        title: "部门选择器", width: 700, height: 500,
        onload: function () {
            var iframe = this.getIFrameEl();
            iframe.contentWindow.CheckEventUser(json);
        },
        ondestroy: function (action) {
        	if(typeof(action)=="object"  && action.status==1){
        		  //设置部门选择器中的内容
        		setDeptselectInput(action.rows,name,valuefield);
        	}
          
        }
    });
}

//设置部门选择器中的值
function setDeptselectInput (rtdata,name,valuefield){
	var data = mini.clone(rtdata);
	var valueArr = [];
	var textArr = [];
	for(var i=0; i<data.length; i++){
		valueArr.push(data[i].orgId);
		textArr.push(data[i].orgName);
	}
	mini.getbyName(name).setValue(textArr.join(","));
	if(mini.getbyName(valuefield)){
		mini.getbyName(valuefield).setValue(valueArr.join(","));
	}
}
